#include "ThreadPool.hpp"
#include <memory>
#include <unistd.h>
#include <ctime>

int main()
{
    srand(time(nullptr) ^ getpid());
    std::unique_ptr<ThreadPool<int>> tp(new ThreadPool<int>);


    ThreadPool<int>::GetInstance()->start();
    // tp->start();

    while(1){
        
        int task = rand() % 100;
        //生产一个任务
        ThreadPool<int>::GetInstance()->Push(task);
        // tp->Push(task);
        
        sleep(1);
    }

    return 0;
}